package str

func firstUniqChar(s string) int {
	var charlist [26]int
	for _, ch := range s {
		charlist[ch-'a']++
	}

	for i, ch := range s {
		if charlist[ch-'a'] == 1 {
			return i
		}
	}

	return -1
}
